home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / AIncludes / DriverServices.a < prev    next >
Encoding:
Text File  |  1997-08-12  |  21.3 KB  |  839 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        DriverServices.a
  3. ;
  4. ;    Contains:    Driver Services Interfaces.
  5. ;
  6. ;    Version:    Technology:    PowerSurge 1.0.2 and beyond (including Copland)
  7. ;                Release:    Universal Interfaces 3.0.1
  8. ;
  9. ;    Copyright:    © 1985-1997 by Apple Computer, Inc., all rights reserved
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__DRIVERSERVICES__') = 'UNDEFINED' THEN
  19. __DRIVERSERVICES__ SET 1
  20.  
  21.     IF &TYPE('__CONDITIONALMACROS__') = 'UNDEFINED' THEN
  22.     include 'ConditionalMacros.a'
  23.     ENDIF
  24.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  25.     include 'Types.a'
  26.     ENDIF
  27.     IF &TYPE('__ERRORS__') = 'UNDEFINED' THEN
  28.     include 'Errors.a'
  29.     ENDIF
  30.     IF &TYPE('__MACHINEEXCEPTIONS__') = 'UNDEFINED' THEN
  31.     include 'MachineExceptions.a'
  32.     ENDIF
  33.     IF &TYPE('__DEVICES__') = 'UNDEFINED' THEN
  34.     include 'Devices.a'
  35.     ENDIF
  36.     IF &TYPE('__DRIVERSYNCHRONIZATION__') = 'UNDEFINED' THEN
  37.     include 'DriverSynchronization.a'
  38.     ENDIF
  39.  
  40. ; ******************************************************************
  41. ; *
  42. ; *         Previously in Kernel.h
  43. ; *
  44. ; *****************************************************************
  45.  
  46. ;  Kernel basics
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55. ;  OrderedItem stuff
  56. ; typedef OSType                         OrderedItemService
  57.  
  58. ; typedef OSType                         OrderedItemSignature
  59.  
  60.  
  61. kMatchAnyOrderedItemService        EQU        '****'
  62. kMatchAnyOrderedItemSignature    EQU        '****'
  63. kDoNotMatchAnyOrderedItemService EQU    '----'
  64. kDoNotMatchAnyOrderedItemSignature EQU    '----'
  65. OrderedItemName            RECORD 0
  66. service                     ds.l    1                ; offset: $0 (0)
  67. signature                 ds.l    1                ; offset: $4 (4)
  68. sizeof                     EQU *                    ; size:   $8 (8)
  69.                         ENDR
  70. ; typedef struct OrderedItemName *        OrderedItemNamePtr
  71.  
  72. ; typedef OptionBits                     OrderedItemOptions
  73.  
  74.  
  75. kOrderedItemIsRightBefore        EQU        $00000001
  76. kOrderedItemIsRightAfter        EQU        $00000002
  77. OrderRequirements        RECORD 0
  78. options                     ds.l    1                ; offset: $0 (0)
  79. itemBefore                 ds        OrderedItemName ; offset: $4 (4)
  80. itemAfter                 ds        OrderedItemName ; offset: $C (12)
  81. sizeof                     EQU *                    ; size:   $14 (20)
  82.                         ENDR
  83. ; typedef struct OrderRequirements *    OrderRequirementsPtr
  84.  
  85. ;  Tasking
  86. ; typedef UInt32                         ExecutionLevel
  87.  
  88.  
  89. kTaskLevel                        EQU        0
  90. kSoftwareInterruptLevel            EQU        1
  91. kAcceptFunctionLevel            EQU        2
  92. kKernelLevel                    EQU        3
  93. kSIHAcceptFunctionLevel            EQU        4
  94. kSecondaryInterruptLevel        EQU        5
  95. kHardwareInterruptLevel            EQU        6
  96.  
  97. kCurrentAddressSpaceID            EQU        -1
  98.  
  99. ;  Memory System basics
  100. LogicalAddressRange        RECORD 0
  101. address                     ds.l    1                ; offset: $0 (0)
  102. count                     ds.l    1                ; offset: $4 (4)
  103. sizeof                     EQU *                    ; size:   $8 (8)
  104.                         ENDR
  105. ; typedef struct LogicalAddressRange *    LogicalAddressRangePtr
  106.  
  107. PhysicalAddressRange    RECORD 0
  108. address                     ds.l    1                ; offset: $0 (0)
  109. count                     ds.l    1                ; offset: $4 (4)
  110. sizeof                     EQU *                    ; size:   $8 (8)
  111.                         ENDR
  112. ; typedef struct PhysicalAddressRange *    PhysicalAddressRangePtr
  113.  
  114. ;  For PrepareMemoryForIO and CheckpointIO
  115. ; typedef OptionBits                     IOPreparationOptions
  116.  
  117.  
  118. kIOMultipleRanges                EQU        $00000001
  119. kIOLogicalRanges                EQU        $00000002
  120. kIOMinimalLogicalMapping        EQU        $00000004
  121. kIOShareMappingTables            EQU        $00000008
  122. kIOIsInput                        EQU        $00000010
  123. kIOIsOutput                        EQU        $00000020
  124. kIOCoherentDataPath                EQU        $00000040
  125. kIOTransferIsLogical            EQU        $00000080
  126. kIOClientIsUserMode                EQU        $00000080
  127. ; typedef OptionBits                     IOPreparationState
  128.  
  129.  
  130. kIOStateDone                    EQU        $00000001
  131.  
  132. kInvalidPageAddress                EQU        -1
  133. AddressRange            RECORD 0
  134. base                     ds.l    1                ; offset: $0 (0)
  135. length                     ds.l    1                ; offset: $4 (4)
  136. sizeof                     EQU *                    ; size:   $8 (8)
  137.                         ENDR
  138. ;  C's treatment of arrays and array pointers is atypical
  139. LogicalMappingTable        RECORD 0
  140. elements                 ds.l    1
  141. sizeof                     EQU *                    ; size:   $4 (4)
  142.                         ENDR
  143.  
  144.  
  145. ; typedef LogicalMappingTable *            LogicalMappingTablePtr
  146.  
  147. PhysicalMappingTable    RECORD 0
  148. elements                 ds.l    1
  149. sizeof                     EQU *                    ; size:   $4 (4)
  150.                         ENDR
  151.  
  152.  
  153. ; typedef PhysicalMappingTable *        PhysicalMappingTablePtr
  154.  
  155. AddressRangeTable        RECORD 0
  156. elements                 ds.b    1 * AddressRange.sizeof
  157. sizeof                     EQU *                    ; size:   $8 (8)
  158.                         ENDR
  159.  
  160.  
  161. ; typedef AddressRangeTable *            AddressRangeTablePtr
  162.  
  163. MultipleAddressRange    RECORD 0
  164. entryCount                 ds.l    1                ; offset: $0 (0)
  165. rangeTable                 ds.l    1                ; offset: $4 (4)
  166. sizeof                     EQU *                    ; size:   $8 (8)
  167.                         ENDR
  168.  
  169. ;   Separate C definition so that union has a name.  A future version of the interfacer
  170. ;   tool will allow a name (that gets thrown out in Pascal and Asm).
  171.  
  172.  
  173. IOPreparationTable        RECORD 0
  174. options                     ds.l    1                ; offset: $0 (0)
  175. state                     ds.l    1                ; offset: $4 (4)
  176. preparationID             ds.l    1                ; offset: $8 (8)
  177. addressSpace             ds.l    1                ; offset: $C (12)
  178. granularity                 ds.l    1                ; offset: $10 (16)
  179. firstPrepared             ds.l    1                ; offset: $14 (20)
  180. lengthPrepared             ds.l    1                ; offset: $18 (24)
  181. mappingEntryCount         ds.l    1                ; offset: $1C (28)
  182. logicalMapping             ds.l    1                ; offset: $20 (32)
  183. physicalMapping             ds.l    1                ; offset: $24 (36)
  184. range                     ds        AddressRange    ; offset: $28 (40)
  185.                          ORG 40
  186. multipleRanges             ds        MultipleAddressRange ; offset: $28 (40)
  187. sizeof                     EQU *                    ; size:   $30 (48)
  188.                         ENDR
  189. ; typedef OptionBits                     IOCheckpointOptions
  190.  
  191.  
  192. kNextIOIsInput                    EQU        $00000001
  193. kNextIOIsOutput                    EQU        $00000002
  194. kMoreIOTransfers                EQU        $00000004
  195. ;  For SetProcessorCacheMode
  196.  
  197. ; typedef UInt32                         ProcessorCacheMode
  198.  
  199.  
  200. kProcessorCacheModeDefault        EQU        0
  201. kProcessorCacheModeInhibited    EQU        1
  202. kProcessorCacheModeWriteThrough    EQU        2
  203. kProcessorCacheModeCopyBack        EQU        3
  204. ;  For GetPageInformation
  205.  
  206.  
  207. kPageInformationVersion            EQU        1
  208. ; typedef UInt32                         PageStateInformation
  209.  
  210.  
  211. kPageIsProtected                EQU        $00000001
  212. kPageIsProtectedPrivileged        EQU        $00000002
  213. kPageIsModified                    EQU        $00000004
  214. kPageIsReferenced                EQU        $00000008
  215. kPageIsLockedResident            EQU        $00000010
  216. kPageIsInMemory                    EQU        $00000020
  217. kPageIsShared                    EQU        $00000040
  218. kPageIsWriteThroughCached        EQU        $00000080
  219. kPageIsCopyBackCached            EQU        $00000100
  220. kPageIsLocked                    EQU        $00000010            ; Deprecated
  221. kPageIsResident                    EQU        $00000020            ; Deprecated
  222. PageInformation            RECORD 0
  223. area                     ds.l    1                ; offset: $0 (0)
  224. count                     ds.l    1                ; offset: $4 (4)
  225. information                 ds.l    1                ; offset: $8 (8) <-- really an array of length one
  226. sizeof                     EQU *                    ; size:   $C (12)
  227.                         ENDR
  228. ; typedef struct PageInformation *        PageInformationPtr
  229.  
  230.  
  231. ;   Tasks  
  232. ;
  233. ; extern ExecutionLevel CurrentExecutionLevel(void )
  234. ;
  235.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  236.         IMPORT_CFM_FUNCTION CurrentExecutionLevel
  237.     ENDIF
  238.  
  239. ;
  240. ; extern TaskID CurrentTaskID(void )
  241. ;
  242.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  243.         IMPORT_CFM_FUNCTION CurrentTaskID
  244.     ENDIF
  245.  
  246. ;
  247. ; extern OSStatus DelayFor(Duration delayDuration)
  248. ;
  249.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  250.         IMPORT_CFM_FUNCTION DelayFor
  251.     ENDIF
  252.  
  253. ;
  254. ; extern Boolean InPrivilegedMode(void )
  255. ;
  256.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  257.         IMPORT_CFM_FUNCTION InPrivilegedMode
  258.     ENDIF
  259.  
  260.  
  261. ;   Software Interrupts  
  262. ;
  263. ; extern OSStatus CreateSoftwareInterrupt(SoftwareInterruptHandler handler, TaskID task, void *p1, Boolean persistent, SoftwareInterruptID *theSoftwareInterrupt)
  264. ;
  265.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  266.         IMPORT_CFM_FUNCTION CreateSoftwareInterrupt
  267.     ENDIF
  268.  
  269.  
  270. ;
  271. ; extern OSStatus SendSoftwareInterrupt(SoftwareInterruptID theSoftwareInterrupt, void *p2)
  272. ;
  273.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  274.         IMPORT_CFM_FUNCTION SendSoftwareInterrupt
  275.     ENDIF
  276.  
  277. ;
  278. ; extern OSStatus DeleteSoftwareInterrupt(SoftwareInterruptID theSoftwareInterrupt)
  279. ;
  280.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  281.         IMPORT_CFM_FUNCTION DeleteSoftwareInterrupt
  282.     ENDIF
  283.  
  284. ;   Secondary Interrupts  
  285. ;
  286. ; extern OSStatus CallSecondaryInterruptHandler2(SecondaryInterruptHandler2 theHandler, ExceptionHandler exceptionHandler, void *p1, void *p2)
  287. ;
  288.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  289.         IMPORT_CFM_FUNCTION CallSecondaryInterruptHandler2
  290.     ENDIF
  291.  
  292. ;
  293. ; extern OSStatus QueueSecondaryInterruptHandler(SecondaryInterruptHandler2 theHandler, ExceptionHandler exceptionHandler, void *p1, void *p2)
  294. ;
  295.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  296.         IMPORT_CFM_FUNCTION QueueSecondaryInterruptHandler
  297.     ENDIF
  298.  
  299.  
  300. ;   Timers  
  301. ;
  302. ; extern OSStatus SetInterruptTimer(const AbsoluteTime *expirationTime, SecondaryInterruptHandler2 handler, void *p1, TimerID *theTimer)
  303. ;
  304.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  305.         IMPORT_CFM_FUNCTION SetInterruptTimer
  306.     ENDIF
  307.  
  308. ;
  309. ; extern OSStatus CancelTimer(TimerID theTimer, AbsoluteTime *timeRemaining)
  310. ;
  311.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  312.         IMPORT_CFM_FUNCTION CancelTimer
  313.     ENDIF
  314.  
  315.  
  316. ;   I/O related Operations  
  317. ;
  318. ; extern OSStatus PrepareMemoryForIO(IOPreparationTable *theIOPreparationTable)
  319. ;
  320.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  321.         IMPORT_CFM_FUNCTION PrepareMemoryForIO
  322.     ENDIF
  323.  
  324. ;
  325. ; extern OSStatus CheckpointIO(IOPreparationID theIOPreparation, IOCheckpointOptions options)
  326. ;
  327.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  328.         IMPORT_CFM_FUNCTION CheckpointIO
  329.     ENDIF
  330.  
  331.  
  332. ;   Memory Operations  
  333. ;
  334. ; extern OSStatus GetPageInformation(AddressSpaceID addressSpace, ConstLogicalAddress base, ItemCount requestedPages, PBVersion version, PageInformation *thePageInfo)
  335. ;
  336.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  337.         IMPORT_CFM_FUNCTION GetPageInformation
  338.     ENDIF
  339.  
  340. ;   Processor Cache Related  
  341. ;
  342. ; extern OSStatus SetProcessorCacheMode(AddressSpaceID addressSpace, ConstLogicalAddress base, ByteCount length, ProcessorCacheMode cacheMode)
  343. ;
  344.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  345.         IMPORT_CFM_FUNCTION SetProcessorCacheMode
  346.     ENDIF
  347.  
  348. ; ******************************************************************
  349. ; *
  350. ; *         Was in DriverSupport.h or DriverServices.h
  351. ; *
  352. ; *****************************************************************
  353.  
  354. ; typedef LogicalAddress *                DeviceLogicalAddressPtr
  355.  
  356.  
  357. durationMicrosecond                EQU        -1                    ; Microseconds are negative
  358. durationMillisecond                EQU        1                    ; Milliseconds are positive
  359. durationSecond                    EQU        1000                ; 1000 * durationMillisecond
  360. durationMinute                    EQU        60000                ; 60 * durationSecond,
  361. durationHour                    EQU        3600000                ; 60 * durationMinute,
  362. durationDay                        EQU        86400000            ; 24 * durationHour,
  363. durationNoWait                    EQU        0                    ; don't block
  364. durationForever                    EQU        $7FFFFFFF            ; no time limit
  365.  
  366. k8BitAccess                        EQU        0                    ; access as 8 bit
  367. k16BitAccess                    EQU        1                    ; access as 16 bit
  368. k32BitAccess                    EQU        2                    ; access as 32 bit
  369. Nanoseconds                RECORD 0
  370. f                         ds        UnsignedWide
  371. sizeof                     EQU *                    ; size:   $8 (8)
  372.                         ENDR
  373.  
  374.  
  375.  
  376. ;
  377. ; extern OSErr IOCommandIsComplete(IOCommandID theID, OSErr theResult)
  378. ;
  379.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  380.         IMPORT_CFM_FUNCTION IOCommandIsComplete
  381.     ENDIF
  382.  
  383. ;
  384. ; extern OSErr GetIOCommandInfo(IOCommandID theID, IOCommandContents *theContents, IOCommandCode *theCommand, IOCommandKind *theKind)
  385. ;
  386.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  387.         IMPORT_CFM_FUNCTION GetIOCommandInfo
  388.     ENDIF
  389.  
  390. ;
  391. ; extern void UpdateDeviceActivity(RegEntryID *deviceEntry)
  392. ;
  393.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  394.         IMPORT_CFM_FUNCTION UpdateDeviceActivity
  395.     ENDIF
  396.  
  397. ;
  398. ; extern void BlockCopy(const void *srcPtr, void *destPtr, Size byteCount)
  399. ;
  400.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  401.         IMPORT_CFM_FUNCTION BlockCopy
  402.     ENDIF
  403.  
  404. ;
  405. ; extern LogicalAddress PoolAllocateResident(ByteCount byteSize, Boolean clear)
  406. ;
  407.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  408.         IMPORT_CFM_FUNCTION PoolAllocateResident
  409.     ENDIF
  410.  
  411. ;
  412. ; extern OSStatus PoolDeallocate(LogicalAddress address)
  413. ;
  414.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  415.         IMPORT_CFM_FUNCTION PoolDeallocate
  416.     ENDIF
  417.  
  418. ;
  419. ; extern ByteCount GetLogicalPageSize(void )
  420. ;
  421.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  422.         IMPORT_CFM_FUNCTION GetLogicalPageSize
  423.     ENDIF
  424.  
  425. ;
  426. ; extern ByteCount GetDataCacheLineSize(void )
  427. ;
  428.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  429.         IMPORT_CFM_FUNCTION GetDataCacheLineSize
  430.     ENDIF
  431.  
  432. ;
  433. ; extern OSStatus FlushProcessorCache(AddressSpaceID spaceID, LogicalAddress base, ByteCount length)
  434. ;
  435.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  436.         IMPORT_CFM_FUNCTION FlushProcessorCache
  437.     ENDIF
  438.  
  439. ;
  440. ; extern LogicalAddress MemAllocatePhysicallyContiguous(ByteCount byteSize, Boolean clear)
  441. ;
  442.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  443.         IMPORT_CFM_FUNCTION MemAllocatePhysicallyContiguous
  444.     ENDIF
  445.  
  446. ;
  447. ; extern OSStatus MemDeallocatePhysicallyContiguous(LogicalAddress address)
  448. ;
  449.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  450.         IMPORT_CFM_FUNCTION MemDeallocatePhysicallyContiguous
  451.     ENDIF
  452.  
  453.  
  454. ;
  455. ; extern AbsoluteTime UpTime(void )
  456. ;
  457.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  458.         IMPORT_CFM_FUNCTION UpTime
  459.     ENDIF
  460.  
  461. ;
  462. ; extern void GetTimeBaseInfo(UInt32 *minAbsoluteTimeDelta, UInt32 *theAbsoluteTimeToNanosecondNumerator, UInt32 *theAbsoluteTimeToNanosecondDenominator, UInt32 *theProcessorToAbsoluteTimeNumerator, UInt32 *theProcessorToAbsoluteTimeDenominator)
  463. ;
  464.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  465.         IMPORT_CFM_FUNCTION GetTimeBaseInfo
  466.     ENDIF
  467.  
  468.  
  469. ;
  470. ; extern Nanoseconds AbsoluteToNanoseconds(AbsoluteTime absoluteTime)
  471. ;
  472.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  473.         IMPORT_CFM_FUNCTION AbsoluteToNanoseconds
  474.     ENDIF
  475.  
  476. ;
  477. ; extern Duration AbsoluteToDuration(AbsoluteTime absoluteTime)
  478. ;
  479.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  480.         IMPORT_CFM_FUNCTION AbsoluteToDuration
  481.     ENDIF
  482.  
  483. ;
  484. ; extern AbsoluteTime NanosecondsToAbsolute(Nanoseconds nanoseconds)
  485. ;
  486.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  487.         IMPORT_CFM_FUNCTION NanosecondsToAbsolute
  488.     ENDIF
  489.  
  490. ;
  491. ; extern AbsoluteTime DurationToAbsolute(Duration duration)
  492. ;
  493.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  494.         IMPORT_CFM_FUNCTION DurationToAbsolute
  495.     ENDIF
  496.  
  497. ;
  498. ; extern AbsoluteTime AddAbsoluteToAbsolute(AbsoluteTime absoluteTime1, AbsoluteTime absoluteTime2)
  499. ;
  500.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  501.         IMPORT_CFM_FUNCTION AddAbsoluteToAbsolute
  502.     ENDIF
  503.  
  504. ;
  505. ; extern AbsoluteTime SubAbsoluteFromAbsolute(AbsoluteTime leftAbsoluteTime, AbsoluteTime rightAbsoluteTime)
  506. ;
  507.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  508.         IMPORT_CFM_FUNCTION SubAbsoluteFromAbsolute
  509.     ENDIF
  510.  
  511. ;
  512. ; extern AbsoluteTime AddNanosecondsToAbsolute(Nanoseconds nanoseconds, AbsoluteTime absoluteTime)
  513. ;
  514.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  515.         IMPORT_CFM_FUNCTION AddNanosecondsToAbsolute
  516.     ENDIF
  517.  
  518. ;
  519. ; extern AbsoluteTime AddDurationToAbsolute(Duration duration, AbsoluteTime absoluteTime)
  520. ;
  521.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  522.         IMPORT_CFM_FUNCTION AddDurationToAbsolute
  523.     ENDIF
  524.  
  525. ;
  526. ; extern AbsoluteTime SubNanosecondsFromAbsolute(Nanoseconds nanoseconds, AbsoluteTime absoluteTime)
  527. ;
  528.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  529.         IMPORT_CFM_FUNCTION SubNanosecondsFromAbsolute
  530.     ENDIF
  531.  
  532. ;
  533. ; extern AbsoluteTime SubDurationFromAbsolute(Duration duration, AbsoluteTime absoluteTime)
  534. ;
  535.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  536.         IMPORT_CFM_FUNCTION SubDurationFromAbsolute
  537.     ENDIF
  538.  
  539. ;
  540. ; extern Nanoseconds AbsoluteDeltaToNanoseconds(AbsoluteTime leftAbsoluteTime, AbsoluteTime rightAbsoluteTime)
  541. ;
  542.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  543.         IMPORT_CFM_FUNCTION AbsoluteDeltaToNanoseconds
  544.     ENDIF
  545.  
  546. ;
  547. ; extern Duration AbsoluteDeltaToDuration(AbsoluteTime leftAbsoluteTime, AbsoluteTime rightAbsoluteTime)
  548. ;
  549.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  550.         IMPORT_CFM_FUNCTION AbsoluteDeltaToDuration
  551.     ENDIF
  552.  
  553. ;
  554. ; extern Nanoseconds DurationToNanoseconds(Duration theDuration)
  555. ;
  556.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  557.         IMPORT_CFM_FUNCTION DurationToNanoseconds
  558.     ENDIF
  559.  
  560. ;
  561. ; extern Duration NanosecondsToDuration(Nanoseconds theNanoseconds)
  562. ;
  563.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  564.         IMPORT_CFM_FUNCTION NanosecondsToDuration
  565.     ENDIF
  566.  
  567.  
  568. ;
  569. ; extern OSErr PBQueueInit(QHdrPtr qHeader)
  570. ;
  571.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  572.         IMPORT_CFM_FUNCTION PBQueueInit
  573.     ENDIF
  574.  
  575. ;
  576. ; extern OSErr PBQueueCreate(QHdrPtr *qHeader)
  577. ;
  578.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  579.         IMPORT_CFM_FUNCTION PBQueueCreate
  580.     ENDIF
  581.  
  582. ;
  583. ; extern OSErr PBQueueDelete(QHdrPtr qHeader)
  584. ;
  585.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  586.         IMPORT_CFM_FUNCTION PBQueueDelete
  587.     ENDIF
  588.  
  589. ;
  590. ; extern void PBEnqueue(QElemPtr qElement, QHdrPtr qHeader)
  591. ;
  592.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  593.         IMPORT_CFM_FUNCTION PBEnqueue
  594.     ENDIF
  595.  
  596. ;
  597. ; extern OSErr PBEnqueueLast(QElemPtr qElement, QHdrPtr qHeader)
  598. ;
  599.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  600.         IMPORT_CFM_FUNCTION PBEnqueueLast
  601.     ENDIF
  602.  
  603. ;
  604. ; extern OSErr PBDequeue(QElemPtr qElement, QHdrPtr qHeader)
  605. ;
  606.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  607.         IMPORT_CFM_FUNCTION PBDequeue
  608.     ENDIF
  609.  
  610. ;
  611. ; extern OSErr PBDequeueFirst(QHdrPtr qHeader, QElemPtr *theFirstqElem)
  612. ;
  613.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  614.         IMPORT_CFM_FUNCTION PBDequeueFirst
  615.     ENDIF
  616.  
  617. ;
  618. ; extern OSErr PBDequeueLast(QHdrPtr qHeader, QElemPtr *theLastqElem)
  619. ;
  620.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  621.         IMPORT_CFM_FUNCTION PBDequeueLast
  622.     ENDIF
  623.  
  624. ;
  625. ; extern char *CStrCopy(char *dst, const char *src)
  626. ;
  627.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  628.         IMPORT_CFM_FUNCTION CStrCopy
  629.     ENDIF
  630.  
  631. ;
  632. ; extern StringPtr PStrCopy(StringPtr dst, ConstStr255Param src)
  633. ;
  634.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  635.         IMPORT_CFM_FUNCTION PStrCopy
  636.     ENDIF
  637.  
  638. ;
  639. ; extern char *CStrNCopy(char *dst, const char *src, UInt32 max)
  640. ;
  641.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  642.         IMPORT_CFM_FUNCTION CStrNCopy
  643.     ENDIF
  644.  
  645. ;
  646. ; extern StringPtr PStrNCopy(StringPtr dst, ConstStr255Param src, UInt32 max)
  647. ;
  648.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  649.         IMPORT_CFM_FUNCTION PStrNCopy
  650.     ENDIF
  651.  
  652. ;
  653. ; extern char *CStrCat(char *dst, const char *src)
  654. ;
  655.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  656.         IMPORT_CFM_FUNCTION CStrCat
  657.     ENDIF
  658.  
  659. ;
  660. ; extern StringPtr PStrCat(StringPtr dst, ConstStr255Param src)
  661. ;
  662.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  663.         IMPORT_CFM_FUNCTION PStrCat
  664.     ENDIF
  665.  
  666. ;
  667. ; extern char *CStrNCat(char *dst, const char *src, UInt32 max)
  668. ;
  669.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  670.         IMPORT_CFM_FUNCTION CStrNCat
  671.     ENDIF
  672.  
  673. ;
  674. ; extern StringPtr PStrNCat(StringPtr dst, ConstStr255Param src, UInt32 max)
  675. ;
  676.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  677.         IMPORT_CFM_FUNCTION PStrNCat
  678.     ENDIF
  679.  
  680. ;
  681. ; extern void PStrToCStr(char *dst, ConstStr255Param src)
  682. ;
  683.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  684.         IMPORT_CFM_FUNCTION PStrToCStr
  685.     ENDIF
  686.  
  687. ;
  688. ; extern void CStrToPStr(Str255 dst, const char *src)
  689. ;
  690.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  691.         IMPORT_CFM_FUNCTION CStrToPStr
  692.     ENDIF
  693.  
  694. ;
  695. ; extern SInt16 CStrCmp(const char *s1, const char *s2)
  696. ;
  697.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  698.         IMPORT_CFM_FUNCTION CStrCmp
  699.     ENDIF
  700.  
  701. ;
  702. ; extern SInt16 PStrCmp(ConstStr255Param str1, ConstStr255Param str2)
  703. ;
  704.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  705.         IMPORT_CFM_FUNCTION PStrCmp
  706.     ENDIF
  707.  
  708. ;
  709. ; extern SInt16 CStrNCmp(const char *s1, const char *s2, UInt32 max)
  710. ;
  711.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  712.         IMPORT_CFM_FUNCTION CStrNCmp
  713.     ENDIF
  714.  
  715. ;
  716. ; extern SInt16 PStrNCmp(ConstStr255Param str1, ConstStr255Param str2, UInt32 max)
  717. ;
  718.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  719.         IMPORT_CFM_FUNCTION PStrNCmp
  720.     ENDIF
  721.  
  722. ;
  723. ; extern UInt32 CStrLen(const char *src)
  724. ;
  725.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  726.         IMPORT_CFM_FUNCTION CStrLen
  727.     ENDIF
  728.  
  729. ;
  730. ; extern UInt32 PStrLen(ConstStr255Param src)
  731. ;
  732.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  733.         IMPORT_CFM_FUNCTION PStrLen
  734.     ENDIF
  735.  
  736. ;
  737. ; extern OSStatus DeviceProbe(void *theSrc, void *theDest, UInt32 AccessType)
  738. ;
  739.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  740.         IMPORT_CFM_FUNCTION DeviceProbe
  741.     ENDIF
  742.  
  743. ;
  744. ; extern OSStatus DelayForHardware(AbsoluteTime absoluteTime)
  745. ;
  746.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  747.         IMPORT_CFM_FUNCTION DelayForHardware
  748.     ENDIF
  749.  
  750.  
  751.  
  752. ; ******************************************************************
  753. ; *
  754. ; *         Was in Interrupts.h 
  755. ; *
  756. ; *****************************************************************
  757.  
  758. ;   Interrupt types  
  759.  
  760.  
  761. ; typedef long                             InterruptMemberNumber
  762.  
  763. InterruptSetMember        RECORD 0
  764. setID                     ds.l    1                ; offset: $0 (0)
  765. member                     ds.l    1                ; offset: $4 (4)
  766. sizeof                     EQU *                    ; size:   $8 (8)
  767.                         ENDR
  768.  
  769. kISTChipInterruptSource            EQU        0
  770. kISTOutputDMAInterruptSource    EQU        1
  771. kISTInputDMAInterruptSource        EQU        2
  772. kISTPropertyMemberCount            EQU        3
  773. ISTProperty                RECORD 0
  774. elements                 ds.b    3 * InterruptSetMember.sizeof
  775. sizeof                     EQU *                    ; size:   $18 (24)
  776.                         ENDR
  777.  
  778.  
  779. ; typedef long                             InterruptReturnValue
  780.  
  781.  
  782. kFirstMemberNumber                EQU        1
  783. kIsrIsComplete                    EQU        0
  784. kIsrIsNotComplete                EQU        -1
  785. kMemberNumberParent                EQU        -2
  786. ; typedef Boolean                         InterruptSourceState
  787.  
  788.  
  789. kSourceWasEnabled                EQU        1
  790. kSourceWasDisabled                EQU        0
  791.  
  792.  
  793. kReturnToParentWhenComplete        EQU        $00000001
  794. kReturnToParentWhenNotComplete    EQU        $00000002
  795. ; typedef OptionBits                     InterruptSetOptions
  796.  
  797. ;   Interrupt Services  
  798. ;
  799. ; extern OSStatus CreateInterruptSet(InterruptSetID parentSet, InterruptMemberNumber parentMember, InterruptMemberNumber setSize, InterruptSetID *setID, InterruptSetOptions options)
  800. ;
  801.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  802.         IMPORT_CFM_FUNCTION CreateInterruptSet
  803.     ENDIF
  804.  
  805.  
  806. ;
  807. ; extern OSStatus InstallInterruptFunctions(InterruptSetID setID, InterruptMemberNumber member, void *refCon, InterruptHandler handlerFunction, InterruptEnabler enableFunction, InterruptDisabler disableFunction)
  808. ;
  809.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  810.         IMPORT_CFM_FUNCTION InstallInterruptFunctions
  811.     ENDIF
  812.  
  813.  
  814. ;
  815. ; extern OSStatus GetInterruptFunctions(InterruptSetID setID, InterruptMemberNumber member, void **refCon, InterruptHandler *handlerFunction, InterruptEnabler *enableFunction, InterruptDisabler *disableFunction)
  816. ;
  817.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  818.         IMPORT_CFM_FUNCTION GetInterruptFunctions
  819.     ENDIF
  820.  
  821. ;
  822. ; extern OSStatus ChangeInterruptSetOptions(InterruptSetID setID, InterruptSetOptions options)
  823. ;
  824.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  825.         IMPORT_CFM_FUNCTION ChangeInterruptSetOptions
  826.     ENDIF
  827.  
  828. ;
  829. ; extern OSStatus GetInterruptSetOptions(InterruptSetID setID, InterruptSetOptions *options)
  830. ;
  831.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  832.         IMPORT_CFM_FUNCTION GetInterruptSetOptions
  833.     ENDIF
  834.  
  835.  
  836.  
  837.     ENDIF ; __DRIVERSERVICES__ 
  838.  
  839.